﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using DTcms.Common;

namespace DTcms.Web
{
    public partial class index : System.Web.UI.Page
    {
        protected DataTable dtMenu = null;
        protected DataTable dtMovie = null;
        protected string connnt1 = "";
        protected string connnt2 = "";
        protected string connnt3 = "";
        protected string connnt4 = "";
        protected string connnt5 = "";
        protected Model.article modelA;
       
        protected void Page_Load(object sender, EventArgs e)
        {

            rptTeam.DataSource = new BLL.article_category().GetChildList(1, 1);
            rptTeam.DataBind();
            connnt1 = new BLL.article().GetModel(109).zhaiyao;
            connnt2 = new BLL.article().GetModel(111).zhaiyao;
            connnt3 = new BLL.article().GetModel(110).zhaiyao;
            connnt4 = new BLL.article_category().GetModel(82).title;
            connnt5 = new BLL.article_category().GetModel(82).seo_keywords;
            Repeater1.DataSource = new BLL.article().GetList(1, "channel_id=1 and category_id=33", "sort_id,add_time desc");
            Repeater1.DataBind();
            Repeater2.DataSource = new BLL.article().GetList(2, "channel_id=1 and category_id=36", "sort_id,add_time desc");
            Repeater2.DataBind();
            Repeater3.DataSource = new BLL.article_category().GetChildList(56, 2);
            Repeater3.DataBind();
            Repeater4.DataSource = new BLL.article_category().GetList2(3,57,2);
            Repeater4.DataBind();
            Repeater5.DataSource = new BLL.article_category().GetList(69, 4);
            Repeater5.DataBind();
            Repeater6.DataSource = new BLL.article().GetList(3, "channel_id=4 and category_id=65", "sort_id,add_time desc");
            Repeater6.DataBind();
            Repeater7.DataSource = new BLL.article().GetList(3, "channel_id=4 and category_id=66", "sort_id,add_time desc");
            Repeater7.DataBind();
            Repeater8.DataSource = new BLL.article().GetList(3, "channel_id=4 and category_id=67", "sort_id,add_time desc");
            Repeater8.DataBind();
            Repeater9.DataSource = new BLL.article().GetList(3, "channel_id=4 and category_id=68", "sort_id,add_time desc");
            Repeater9.DataBind();

            dtMovie = new BLL.article_category().GetList(77, 6);
           
        }

        public string MovieList(string cid)
        {

            StringBuilder html1 = new StringBuilder();
            StringBuilder html2 = new StringBuilder();
            DataTable dt = new BLL.article().GetList(6, int.Parse(cid)).Tables[0];
            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    html1.Append("<li><a href=\"movie.aspx?id=" + dt.Rows[i]["id"] + "\" target=\"_blank\"><img src =\"" + dt.Rows[i]["img_url"] + "\" /></a></li>");
                    html2.Append("<li><a ><img src =\"" + dt.Rows[i]["img_url"] + "\" /></a></li>");
                }
            }

            StringBuilder html = new StringBuilder();
            html.Append(" <div class=\"ix - video\">");
            html.Append(" <div class=\"game163\" style=\"margin: 0 auto\"> ");
            html.Append(" <ul class=\"bigImg\">" + html1 + "</ul>");
            html.Append(" <div class=\"smallScroll\">");
            html.Append(" <div class=\"smallImg rel\">");
            html.Append(" <a class=\"sPrev abs\" href=\"javascript: void(0)\"></a>");
            html.Append(" <a class=\"sNext abs\" href=\"javascript: void(0)\"></a>");
            html.Append(" <ul>" + html2 + "</ul>");
            html.Append(" </div></div></div></div>");
            return html.ToString();
        }


    }
}